using UnityEngine;
using System.Collections;

public class SimpleBall : Bullet
{
	
	//------------------------------
	public	Vector3	m_vDirection;
	
	// Use this for initialization
	void Start ()
	{
		m_vDirection = Vector3.up;
	}

	// Update is called once per frame
	void Update ()
	{
		transform.Translate(m_vDirection * (m_fSpeed * Time.deltaTime * m_fTimeCoef));
	}
	
	
	// OnCollisionEnter is called when this collider/rigidbody has begun touching another rigidbody/collider
	void onCollisionEnter( Collision _cOther ){
		
		// En funcion del tipo, provocamos danyo, o bien desaparece...
		bool hit = false;
		if( _cOther.gameObject.CompareTag("Player") )
		{
			//player.hit
			hit = true;
		}
		/*
		else if( ...) {}
		*/
		
		if( hit ){
			// Efecto desaparecer?
			// ...
			
			// Destroy bullet
			End();
		}
	}
}

